package evo.selectors;

import java.util.List;

public class HistoricalAvgSelector extends HistoricalSelector {

	public HistoricalAvgSelector(ISelector selector) {
		super(selector);
	}

	@Override
	protected double getVal(List<Double> historicalFitness) {
		double avg = 0;
		for (int i = 0; i < historicalFitness.size(); i++) {
			avg += historicalFitness.get(i);
		}
		return avg / historicalFitness.size();
	}

}
